<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>修改书籍</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/bookList1.css">
    <style>
        .update-book-container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: linear-gradient(135deg, #181c2b 0%, #232946 100%);
        }
        .update-book-card {
            background: rgba(30, 34, 54, 0.95);
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 8px 32px #1e90ff22;
            width: 100%;
            max-width: 400px;
        }
        .update-book-card h2 {
            text-align: center;
            color: #1e90ff;
            margin-bottom: 20px;
        }
        .form-control {
            background: #232946;
            color: #fff;
            border: 1px solid #1e90ff;
        }
        .form-control:focus {
            box-shadow: 0 0 8px #1e90ff88;
        }
        .btn-primary {
            background: #1e90ff;
            border-color: #1e90ff;
        }
        .btn-primary:hover {
            background: #181c2b;
            border-color: #1e90ff;
        }
    </style>
</head>
<body>
<div class="update-book-container">
    <div class="update-book-card">
        <h2>修改书籍</h2>
        <form action="updateBookServlet" method="post">
            <input type="hidden" name="id" value="${param.id}">
            <div class="mb-3">
                <label for="name" class="form-label">书名</label>
                <input type="text" class="form-control" id="name" name="name" value="${param.name}" required>
            </div>
            <div class="mb-3">
                <label for="author" class="form-label">作者</label>
                <input type="text" class="form-control" id="author" name="author" value="${param.author}" required>
            </div>
            <div class="mb-3">
                <label for="category" class="form-label">分类</label>
                <select class="form-control" id="category" name="category">
                    <option value="">请选择分类</option>
                    <option value="文学" ${param.category == '文学' ? 'selected' : ''}>文学</option>
                    <option value="科技" ${param.category == '科技' ? 'selected' : ''}>科技</option>
                    <option value="历史" ${param.category == '历史' ? 'selected' : ''}>历史</option>
                    <option value="艺术" ${param.category == '艺术' ? 'selected' : ''}>艺术</option>
                    <option value="教育" ${param.category == '教育' ? 'selected' : ''}>教育</option>
                    <option value="其他" ${param.category == '其他' ? 'selected' : ''}>其他</option>
                </select>
            </div>
            <div class="mb-3">
                <label for="description" class="form-label">图书简介</label>
                <textarea class="form-control" id="description" name="description" rows="4" placeholder="请输入图书简介...">${param.description}</textarea>
            </div>
            <div class="mb-3">
                <label for="status" class="form-label">状态</label>
                <select class="form-control" id="status" name="status">
                    <option value="在库" ${param.status == '在库' ? 'selected' : ''}>在库</option>
                    <option value="借出" ${param.status == '借出' ? 'selected' : ''}>借出</option>
                    <option value="维护" ${param.status == '维护' ? 'selected' : ''}>维护</option>
                </select>
            </div>
            <button type="submit" class="btn btn-primary w-100">提交</button>
            <a href="menu.jsp" class="btn btn-secondary w-100 mt-2">取消</a>
        </form>
    </div>
</div>
</body>
</html>